import Vue from 'vue'
import VueRouter from 'vue-router'
import AllView from '../views/AllView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'all',
    component: AllView,
    redirect: '/home',
    children:[
      {
        path: '/home',
        name: 'home',
        component: ()=>import("@/views/HomeView.vue")
      },
      {
        path: '/find',
        name: 'find',
        component: ()=>import("@/views/FindView.vue")
      },
      {
        path: '/dynamic',
        name: 'dynamic',
        component: ()=>import("@/views/DynamicView.vue")
      },
      {
        path: '/message',
        name: 'message',
        component: ()=>import("@/views/MessageView.vue")
      },
      {
        path: '/mygame',
        name: 'mygame',
        component: ()=>import("@/views/MyGameView.vue")
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
